﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DWLib;

/*
 * Digital Watch van:   Jiri Waning, Roy Heidotting, Walid Farhan.
 * Gebruikte patterns:  Singleton, Bridge, Observer en Facade.
 * Voor schakeling tussen de verschillende horloge's in de constructor 
 * van de form de variabele digitalWatch wijzigen naar A of B.
 * Voor meer informatie zie commentaar bij de code.
 * */

namespace DigitalWatch2014
{
    public partial class Form1 : Form
    {
        /// <summary>
        /// (Bridge pattern) interface
        /// </summary>
        private IDigitalWatch digitalWatch;

        public Form1()
        {
            InitializeComponent();
            //assign digital watch A or B
            //Digital watch A is hours and minutes
            //Digital Watch B is hours, minutes and seconds
            var digitalWatch = new DigitalWatchB();
            Controls.Add(digitalWatch);
            this.digitalWatch = digitalWatch;
        }
        /// <summary>
        /// Increments the value that is flashing
        /// </summary>
        /// <param name="sender">null</param>
        /// <param name="e">null</param>
        public void incrementClick(object sender, EventArgs e)
        {
            digitalWatch.increment();
        }
        /// <summary>
        /// Decrements the value that is flashing
        /// </summary>
        /// <param name="sender">null</param>
        /// <param name="e">null</param>
        public void decrementClick(object sender, EventArgs e)
        {
            digitalWatch.decrement();
        }
        /// <summary>
        /// Scroll through the Watch to alter hour, minutes and seconds
        /// </summary>
        /// <param name="sender">null</param>
        /// <param name="e">null</param>
        public void changeModeClick(object sender, EventArgs e)
        {
            digitalWatch.changeMode();
        }
    }
}
